<%@ Page Title="ThirdPartyIdentities" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" AutoEventWireup="true" 
	Inherits="System.Web.Mvc.ViewPage<IEnumerable<good1.Core.ThirdPartyIdentity>>" %>
<%@ Import Namespace="good1.Core" %>
<%@ Import Namespace="good1.Web.Controllers" %>

<asp:Content ContentPlaceHolderID="mainContentPlaceHolder" runat="server">
    <h2>ThirdPartyIdentities</h2>

    <% if (ViewContext.TempData["message"] != null){ %>
        <p><%= ViewContext.TempData["message"]%></p>
    <% } %>

    <table>
        <thead>
            <tr>
			    <th>FriendlyName</th>
			    <th>ClaimedIdentifier</th>
			    <th colspan="3">Action</th>
            </tr>
        </thead>

		<%
		foreach (ThirdPartyIdentity thirdPartyIdentity in ViewData.Model) { %>
			<tr>
				<td><%= (thirdPartyIdentity.FriendlyName != null) ? thirdPartyIdentity.FriendlyName.ToString() : ""%></td>
				<td><%= thirdPartyIdentity.ClaimedIdentifier %></td>
				<td><%=Html.ActionLink<ThirdPartyIdentitiesController>( c => c.Show( thirdPartyIdentity.Id ), "Details ") %></td>
				<td><%=Html.ActionLink<ThirdPartyIdentitiesController>( c => c.Edit( thirdPartyIdentity.Id ), "Edit") %></td>
				<td>
    				<% using (Html.BeginForm<ThirdPartyIdentitiesController>(c => c.Delete(thirdPartyIdentity.Id))) { %>
                        <%= Html.AntiForgeryToken() %>
    				    <input type="submit" value="Delete" onclick="return confirm('Are you sure?');" />
                    <% } %>
				</td>
			</tr>
		<%} %>
    </table>

    <p><%= Html.ActionLink<ThirdPartyIdentitiesController>(c => c.Create(), "Create New ThirdPartyIdentity") %></p>
</asp:Content>
